<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    const action = (e) => {
        const map = {
            苏苏: '喜欢追所有的剧',
            娟娟: '喜欢追美剧',
            小黄: "喜欢打游戏"
        }
        if (map[e]) {
            console.log(map[e])
        } else {
            console.log('wu')
        }
    }
    action('苏苏')
    action('娟娟')
    action('小黄')
    action('susu')


    const action1 = (e) => {
        const map = [
            [
                () => e.includes('苏苏'),
                () => console.log(e + '喜欢追所有的剧')
            ],
            [
                () => e.endsWith('娟'),
                () => console.log(e + '喜欢追美剧')
            ],
            [
                () => e.startsWith('小'),
                () => console.log(e + '喜欢打游戏')
            ],

        ]
        const t = map.find(m => m[0]());
        console.log(t)
        if (t) {
            t[1]()
        } else {
            console.log('不作为')
        }
    }
    action1('苏苏')
    action1('娟娟')
    action1('小黄')
    action1('susu')
</script>

</html>